import { defHttp } from "@/utils/http";

// ERP 标准规范 VO
export interface StdSpecVO {
	stdId: number; // 标准ID
	itemName: string; // 名称
	sqNumb: number; // 序号
	grpId: number; // 分组
}

// ERP 标准规范 API
export const StdSpecApi = {
	// 查询标准规范分页
	getStdSpecPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/std-item/page`, params });
	},

	// 查询标准规范详情
	getStdSpec: async (id: number) => {
		return await defHttp.get({ url: `/whs/std-item/get?id=` + id });
	},

	// 新增标准规范
	createStdSpec: async (data: StdSpecVO) => {
		return await defHttp.post({ url: `/whs/std-item/create`, data });
	},

	// 修改标准规范
	updateStdSpec: async (data: StdSpecVO) => {
		return await defHttp.put({ url: `/whs/std-item/update`, data });
	},

	// 删除标准规范
	deleteStdSpec: async (id: number) => {
		return await defHttp.delete({ url: `/whs/std-item/delete?id=` + id });
	},

	// 导出标准规范 Excel
	exportStdSpec: async (params: any) => {
		return await defHttp.download({ url: `/whs/std-item/export-excel`, params });
	}
};
